package com.billy.ohos.loadingstatusview.wrapability;

import com.billy.ohos.loading.Gloading;
import com.billy.ohos.loadingstatusview.wrapability.adapter.SpecialAdapter;

/**
 * demo:
 * use special loading UI
 * load failed and empty status use global UI
 *
 * @author billy.qi
 * @since 19/3/19 23:20
 */
public class SpecialAbility extends GlobalFailedAbility {

    @Override
    protected void initLoadingStatusViewIfNeed() {
        // override this method in subclass to do special initialization
        if (mHolder == null) {
            // create a special Gloading object by SpecialAdapter
            Gloading specialGloading = Gloading.from(new SpecialAdapter());
            mHolder = specialGloading.wrap(this, contentLayout).withRetry(new Runnable() {
                @Override
                public void run() {
                    onLoadRetry();
                }
            });
        }
    }
}
